<?php
namespace app\zhonghang\controller;
use think\Controller;
use think\Request;
use think\Db;
use think\Session;
class Art extends Base {
	//空操作
	public function _empty(){
		header("HTTP/1.0 404 Not Found");
		$this->display('Public:404');
	}

	//公告列表
	public function gonggao(){
	    $list=DB::name('article')->order('add_time desc')->select();
	    if($list){
	        $data['info']='所有公告';
	        $data['status']='1';
	        $data['data']=$list;
	        return json($data);
        }else{
	        $data['info']='暂无数据';
	        $data['status']='-1';
	        $data['data']=array();
	        return json($data);
        }
    }

    //公告详情
    public function gonggaoInfo(){
	    $where['article_id']=input('id');
	    $info=DB::name('article')->where($where)->find();
	    if($info){
            $data['info']='公告详情';
            $data['status']='1';
            $data['data']=$info;
            return json($data);
        }else{
	        $data['info']='参数错误';
	        $data['status']='-1';
	        $data['data']=array();
	        return json($data);
        }
    }


}